/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package job.manager.db.ec;

import java.io.Serializable;
import java.util.Collection;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Lob;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 *
 * @author Administrator
 */
@Entity
@Table(name = "Profiles")
@NamedQueries({@NamedQuery(name = "ProfilesEB.findAll", query = "SELECT p FROM ProfilesEB p"), @NamedQuery(name = "ProfilesEB.findById", query = "SELECT p FROM ProfilesEB p WHERE p.id = :id"), @NamedQuery(name = "ProfilesEB.findByName1", query = "SELECT p FROM ProfilesEB p WHERE p.name1 = :name1"), @NamedQuery(name = "ProfilesEB.findByName2", query = "SELECT p FROM ProfilesEB p WHERE p.name2 = :name2"), @NamedQuery(name = "ProfilesEB.findByNumber", query = "SELECT p FROM ProfilesEB p WHERE p.number = :number"), @NamedQuery(name = "ProfilesEB.findByIsEmployee", query = "SELECT p FROM ProfilesEB p WHERE p.isEmployee = :isEmployee"), @NamedQuery(name = "ProfilesEB.findByIsCustomer", query = "SELECT p FROM ProfilesEB p WHERE p.isCustomer = :isCustomer"),@NamedQuery(name = "ProfilesEB.findByAndAll", query = "SELECT p FROM ProfilesEB p WHERE p.isCustomer = :isCustomer AND p.name1 = :name1 ")})
public class ProfilesEB implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "id")
    private Integer id;
    @Basic(optional = false)
    @Column(name = "Name1")
    private String name1;
    @Basic(optional = false)
    @Column(name = "Name2")
    private String name2;
    @Basic(optional = false)
    @Column(name = "number")
    private String number;
    @Basic(optional = false)
    @Lob
    @Column(name = "Comment")
    private String comment;
    @Basic(optional = false)
    @Column(name = "isEmployee")
    private boolean isEmployee;
    @Basic(optional = false)
    @Column(name = "isCustomer")
    private boolean isCustomer;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "customerId")
    private Collection<JobEB> jobEBCollection;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "profileId")
    private Collection<AddressEB> addressEBCollection;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "profileId")
    private Collection<TimeReportEB> timeReportEBCollection;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "profileId")
    private Collection<ProfileJobMapperEB> profileJobMapperEBCollection;

    public ProfilesEB() {
    }

    public ProfilesEB(Integer id) {
        this.id = id;
    }

    public ProfilesEB(Integer id, String name1, String name2, String number, String comment, boolean isEmployee, boolean isCustomer) {
        this.id = id;
        this.name1 = name1;
        this.name2 = name2;
        this.number = number;
        this.comment = comment;
        this.isEmployee = isEmployee;
        this.isCustomer = isCustomer;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getName1() {
        return name1;
    }

    public void setName1(String name1) {
        this.name1 = name1;
    }

    public String getName2() {
        return name2;
    }

    public void setName2(String name2) {
        this.name2 = name2;
    }

    public String getNumber() {
        return number;
    }

    public void setNumber(String number) {
        this.number = number;
    }

    public String getComment() {
        return comment;
    }

    public void setComment(String comment) {
        this.comment = comment;
    }

    public boolean getIsEmployee() {
        return isEmployee;
    }

    public void setIsEmployee(boolean isEmployee) {
        this.isEmployee = isEmployee;
    }

    public boolean getIsCustomer() {
        return isCustomer;
    }

    public void setIsCustomer(boolean isCustomer) {
        this.isCustomer = isCustomer;
    }

    public Collection<JobEB> getJobEBCollection() {
        return jobEBCollection;
    }

    public void setJobEBCollection(Collection<JobEB> jobEBCollection) {
        this.jobEBCollection = jobEBCollection;
    }

    public Collection<AddressEB> getAddressEBCollection() {
        return addressEBCollection;
    }

    public void setAddressEBCollection(Collection<AddressEB> addressEBCollection) {
        this.addressEBCollection = addressEBCollection;
    }

    public Collection<TimeReportEB> getTimeReportEBCollection() {
        return timeReportEBCollection;
    }

    public void setTimeReportEBCollection(Collection<TimeReportEB> timeReportEBCollection) {
        this.timeReportEBCollection = timeReportEBCollection;
    }

    public Collection<ProfileJobMapperEB> getProfileJobMapperEBCollection() {
        return profileJobMapperEBCollection;
    }

    public void setProfileJobMapperEBCollection(Collection<ProfileJobMapperEB> profileJobMapperEBCollection) {
        this.profileJobMapperEBCollection = profileJobMapperEBCollection;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof ProfilesEB)) {
            return false;
        }
        ProfilesEB other = (ProfilesEB) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "job.manager.db.ec.ProfilesEB[id=" + id + "]";
    }

}
